package com.yeyouluo.dubbox.consumer.test;

import java.io.IOException;
import java.util.List;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.yeyouluo.dubbox.provider.inter.IDemoService;
import com.yeyouluo.dubbox.provider.pojo.User;

public class Consumer {

	public static void main(String[] args) throws IOException {
		ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("dubbox-consumer.xml");
		ac.start();
		
		IDemoService demoService = (IDemoService)ac.getBean("demoService");
		String res = demoService.sayHello("yeyouluo");
		System.out.println(res);
		List<User> users = demoService.getUsers();
		for( User u : users ){
			System.out.println(u.toString());
		}
		
		System.in.read();
	}

}
